package com.kitri.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.kitri.dao.AppContext;
import com.kitri.dao.MemberDao;
import com.kitri.dao.MemberDaoImpl;
import com.kitri.domain.Member;

@Service
public class MemberServiceImpl implements MemberService {
	private MemberDao memberDao = null;

	public MemberServiceImpl() {
		this.memberDao = ((MemberDaoImpl)AppContext.getAppContext().getBean("memberDao"));
	}

	@Override
	public void add(Member member) {
		memberDao.insert(member);
	}
	
	@Override
	public void update(Member member) {
		memberDao.update(member);
	}
	
	@Override
	public void remove(String seqId) {
		memberDao.delete(seqId);
	}
	
	@Override
	public List<Member> list(int memberType) {
		return memberDao.selectAll(memberType);
	}

	@Override
	public String findOfId(String name, String email) {
		return memberDao.findOfId(name, email);
	}

	@Override
	public String findOfPassword(String id, String birthDay, String email) {
		return memberDao.findOfPassword(id, birthDay, email);
	}

	@Override
	public Member loginId(String userName, String password) {
		return memberDao.loginId(userName, password);
	}

	@Override
	public boolean idCheck(String id) {
		return memberDao.idCheck(id);
	}

	@Override
	public Member select(String seqId) {
		return memberDao.select(seqId);
	}
	
	@Override
	public Member selectOfId(String memberId){
		return memberDao.selectOfId(memberId);
	}
}
